{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd \n",
    "pd.set_option('max_columns', 100)\n",
    "import numpy as np \n",
    "import matplotlib.pyplot as plt \n",
    "import seaborn as sns "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "ename": "UnicodeDecodeError",
     "evalue": "'utf-8' codec can't decode byte 0xce in position 0: invalid continuation byte",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mUnicodeDecodeError\u001b[0m                        Traceback (most recent call last)",
      "\u001b[1;32mpandas\\_libs\\parsers.pyx\u001b[0m in \u001b[0;36mpandas._libs.parsers.TextReader._convert_tokens\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;32mpandas\\_libs\\parsers.pyx\u001b[0m in \u001b[0;36mpandas._libs.parsers.TextReader._convert_with_dtype\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;32mpandas\\_libs\\parsers.pyx\u001b[0m in \u001b[0;36mpandas._libs.parsers.TextReader._string_convert\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;32mpandas\\_libs\\parsers.pyx\u001b[0m in \u001b[0;36mpandas._libs.parsers._string_box_utf8\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;31mUnicodeDecodeError\u001b[0m: 'utf-8' codec can't decode byte 0xce in position 0: invalid continuation byte",
      "\nDuring handling of the above exception, another exception occurred:\n",
      "\u001b[1;31mUnicodeDecodeError\u001b[0m                        Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-4-1cd0f102d9c9>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mtrain\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mread_csv\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'happiness_train_complete.csv'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[0mtest\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mread_csv\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'happiness_test_complete.csv'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[0mIDtest\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mtest\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'id'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\io\\parsers.py\u001b[0m in \u001b[0;36mparser_f\u001b[1;34m(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, escapechar, comment, encoding, dialect, tupleize_cols, error_bad_lines, warn_bad_lines, skipfooter, doublequote, delim_whitespace, low_memory, memory_map, float_precision)\u001b[0m\n\u001b[0;32m    676\u001b[0m                     skip_blank_lines=skip_blank_lines)\n\u001b[0;32m    677\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 678\u001b[1;33m         \u001b[1;32mreturn\u001b[0m \u001b[0m_read\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfilepath_or_buffer\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mkwds\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    679\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    680\u001b[0m     \u001b[0mparser_f\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__name__\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mname\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\io\\parsers.py\u001b[0m in \u001b[0;36m_read\u001b[1;34m(filepath_or_buffer, kwds)\u001b[0m\n\u001b[0;32m    444\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    445\u001b[0m     \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 446\u001b[1;33m         \u001b[0mdata\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mparser\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mread\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mnrows\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    447\u001b[0m     \u001b[1;32mfinally\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    448\u001b[0m         \u001b[0mparser\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mclose\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\io\\parsers.py\u001b[0m in \u001b[0;36mread\u001b[1;34m(self, nrows)\u001b[0m\n\u001b[0;32m   1034\u001b[0m                 \u001b[1;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'skipfooter not supported for iteration'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1035\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1036\u001b[1;33m         \u001b[0mret\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_engine\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mread\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mnrows\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   1037\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1038\u001b[0m         \u001b[1;31m# May alter columns / col_dict\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\io\\parsers.py\u001b[0m in \u001b[0;36mread\u001b[1;34m(self, nrows)\u001b[0m\n\u001b[0;32m   1846\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0mread\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mnrows\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mNone\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1847\u001b[0m         \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1848\u001b[1;33m             \u001b[0mdata\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_reader\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mread\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mnrows\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   1849\u001b[0m         \u001b[1;32mexcept\u001b[0m \u001b[0mStopIteration\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1850\u001b[0m             \u001b[1;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_first_chunk\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mpandas\\_libs\\parsers.pyx\u001b[0m in \u001b[0;36mpandas._libs.parsers.TextReader.read\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;32mpandas\\_libs\\parsers.pyx\u001b[0m in \u001b[0;36mpandas._libs.parsers.TextReader._read_low_memory\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;32mpandas\\_libs\\parsers.pyx\u001b[0m in \u001b[0;36mpandas._libs.parsers.TextReader._read_rows\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;32mpandas\\_libs\\parsers.pyx\u001b[0m in \u001b[0;36mpandas._libs.parsers.TextReader._convert_column_data\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;32mpandas\\_libs\\parsers.pyx\u001b[0m in \u001b[0;36mpandas._libs.parsers.TextReader._convert_tokens\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;32mpandas\\_libs\\parsers.pyx\u001b[0m in \u001b[0;36mpandas._libs.parsers.TextReader._convert_with_dtype\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;32mpandas\\_libs\\parsers.pyx\u001b[0m in \u001b[0;36mpandas._libs.parsers.TextReader._string_convert\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;32mpandas\\_libs\\parsers.pyx\u001b[0m in \u001b[0;36mpandas._libs.parsers._string_box_utf8\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;31mUnicodeDecodeError\u001b[0m: 'utf-8' codec can't decode byte 0xce in position 0: invalid continuation byte"
     ]
    }
   ],
   "source": [
    "train = pd.read_csv('happiness_train_complete.csv')\n",
    "test = pd.read_csv('happiness_test_complete.csv')\n",
    "IDtest = test['id']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 合并训练集和测试机"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "train = train[train.happiness != -8]\n",
    "train_len = len(train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\Voyager\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: Sorting because non-concatenation axis is not aligned. A future version\n",
      "of pandas will change to not sort by default.\n",
      "\n",
      "To accept the future behavior, pass 'sort=True'.\n",
      "\n",
      "To retain the current behavior and silence the warning, pass sort=False\n",
      "\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    }
   ],
   "source": [
    "df = pd.concat(objs=[train,test], axis=0).reset_index(drop=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>birth</th>\n",
       "      <th>car</th>\n",
       "      <th>city</th>\n",
       "      <th>class</th>\n",
       "      <th>county</th>\n",
       "      <th>depression</th>\n",
       "      <th>edu</th>\n",
       "      <th>equity</th>\n",
       "      <th>family_income</th>\n",
       "      <th>family_m</th>\n",
       "      <th>family_status</th>\n",
       "      <th>floor_area</th>\n",
       "      <th>gender</th>\n",
       "      <th>happiness</th>\n",
       "      <th>health</th>\n",
       "      <th>health_problem</th>\n",
       "      <th>height_cm</th>\n",
       "      <th>house</th>\n",
       "      <th>hukou</th>\n",
       "      <th>id</th>\n",
       "      <th>inc_ability</th>\n",
       "      <th>income</th>\n",
       "      <th>learn</th>\n",
       "      <th>marital</th>\n",
       "      <th>nationality</th>\n",
       "      <th>political</th>\n",
       "      <th>province</th>\n",
       "      <th>relax</th>\n",
       "      <th>religion</th>\n",
       "      <th>religion_freq</th>\n",
       "      <th>socialize</th>\n",
       "      <th>status_3_before</th>\n",
       "      <th>status_peer</th>\n",
       "      <th>survey_time</th>\n",
       "      <th>survey_type</th>\n",
       "      <th>view</th>\n",
       "      <th>weight_jin</th>\n",
       "      <th>work_exper</th>\n",
       "      <th>work_manage</th>\n",
       "      <th>work_status</th>\n",
       "      <th>work_type</th>\n",
       "      <th>work_yr</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1959</td>\n",
       "      <td>2</td>\n",
       "      <td>32</td>\n",
       "      <td>3</td>\n",
       "      <td>59</td>\n",
       "      <td>5</td>\n",
       "      <td>11</td>\n",
       "      <td>3</td>\n",
       "      <td>60000.0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>45.0</td>\n",
       "      <td>1</td>\n",
       "      <td>4.0</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>176</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>20000</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>12</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>2015/8/4 14:18</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>155</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>30.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1992</td>\n",
       "      <td>2</td>\n",
       "      <td>52</td>\n",
       "      <td>6</td>\n",
       "      <td>85</td>\n",
       "      <td>3</td>\n",
       "      <td>12</td>\n",
       "      <td>3</td>\n",
       "      <td>40000.0</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>110.0</td>\n",
       "      <td>1</td>\n",
       "      <td>4.0</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>170</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>20000</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>18</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2015/7/21 15:04</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>110</td>\n",
       "      <td>1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1967</td>\n",
       "      <td>2</td>\n",
       "      <td>83</td>\n",
       "      <td>5</td>\n",
       "      <td>126</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>8000.0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>120.0</td>\n",
       "      <td>2</td>\n",
       "      <td>4.0</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>160</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>2000</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>29</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2015/7/21 13:24</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>122</td>\n",
       "      <td>2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1943</td>\n",
       "      <td>1</td>\n",
       "      <td>28</td>\n",
       "      <td>5</td>\n",
       "      <td>51</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>12000.0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>78.0</td>\n",
       "      <td>2</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>163</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>6420</td>\n",
       "      <td>4</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2015/7/25 17:33</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>170</td>\n",
       "      <td>4</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1994</td>\n",
       "      <td>1</td>\n",
       "      <td>18</td>\n",
       "      <td>1</td>\n",
       "      <td>36</td>\n",
       "      <td>3</td>\n",
       "      <td>12</td>\n",
       "      <td>2</td>\n",
       "      <td>-2.0</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>70.0</td>\n",
       "      <td>2</td>\n",
       "      <td>4.0</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>165</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>-8</td>\n",
       "      <td>-1</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>2015/8/10 9:50</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>110</td>\n",
       "      <td>6</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   birth  car  city  class  county  depression  edu  equity  family_income  \\\n",
       "0   1959    2    32      3      59           5   11       3        60000.0   \n",
       "1   1992    2    52      6      85           3   12       3        40000.0   \n",
       "2   1967    2    83      5     126           5    4       4         8000.0   \n",
       "3   1943    1    28      5      51           4    3       4        12000.0   \n",
       "4   1994    1    18      1      36           3   12       2           -2.0   \n",
       "\n",
       "   family_m  family_status  floor_area  gender  happiness  health  \\\n",
       "0         2              2        45.0       1        4.0       3   \n",
       "1         3              4       110.0       1        4.0       5   \n",
       "2         3              3       120.0       2        4.0       4   \n",
       "3         3              3        78.0       2        5.0       4   \n",
       "4         4              3        70.0       2        4.0       5   \n",
       "\n",
       "   health_problem  height_cm  house  hukou  id  inc_ability  income  learn  \\\n",
       "0               2        176      1      5   1            3   20000      3   \n",
       "1               4        170      1      1   2            2   20000      3   \n",
       "2               4        160      1      1   3            2    2000      2   \n",
       "3               4        163      1      1   4            2    6420      4   \n",
       "4               5        165      1      2   5           -8      -1      4   \n",
       "\n",
       "   marital  nationality  political  province  relax  religion  religion_freq  \\\n",
       "0        3            1          1        12      4         1              1   \n",
       "1        1            1          1        18      4         1              1   \n",
       "2        3            1          1        29      4         0              3   \n",
       "3        7            1          1        10      4         1              1   \n",
       "4        1            1          2         7      3         1              1   \n",
       "\n",
       "   socialize  status_3_before  status_peer      survey_time  survey_type  \\\n",
       "0          2                2            3   2015/8/4 14:18            1   \n",
       "1          2                1            1  2015/7/21 15:04            2   \n",
       "2          3                1            2  2015/7/21 13:24            2   \n",
       "3          2                1            2  2015/7/25 17:33            2   \n",
       "4          4                2            3   2015/8/10 9:50            1   \n",
       "\n",
       "   view  weight_jin  work_exper  work_manage  work_status  work_type  work_yr  \n",
       "0     4         155           1          2.0          3.0        1.0     30.0  \n",
       "1     4         110           1          3.0          3.0        1.0      2.0  \n",
       "2     4         122           2          NaN          NaN        NaN      NaN  \n",
       "3     3         170           4          NaN          NaN        NaN      NaN  \n",
       "4     3         110           6          NaN          NaN        NaN      NaN  "
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x2f7edb586a0>"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEKCAYAAAAb7IIBAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbW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ACGEiFMSAIQQIk5JABBCiDj1/wE/U1wpIJLN5wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df.groupby('birth')['birth'].count().plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "birth  happiness\n",
       "1921   4.0           1\n",
       "       5.0           1\n",
       "1922   2.0           2\n",
       "       3.0           1\n",
       "       4.0           2\n",
       "       5.0           1\n",
       "1923   4.0           2\n",
       "1924   4.0           1\n",
       "       5.0           3\n",
       "1925   4.0           5\n",
       "       5.0           4\n",
       "1926   2.0           1\n",
       "       3.0           2\n",
       "       4.0           3\n",
       "       5.0           4\n",
       "1927   2.0           1\n",
       "       4.0           8\n",
       "       5.0           2\n",
       "1928   3.0           5\n",
       "       4.0          10\n",
       "       5.0           6\n",
       "1929   2.0           1\n",
       "       3.0           2\n",
       "       4.0          12\n",
       "       5.0           3\n",
       "1930   3.0           6\n",
       "       4.0          20\n",
       "       5.0           9\n",
       "1931   2.0           1\n",
       "       3.0           3\n",
       "                    ..\n",
       "1991   2.0           2\n",
       "       3.0          11\n",
       "       4.0          53\n",
       "       5.0          20\n",
       "1992   1.0           2\n",
       "       2.0           2\n",
       "       3.0          22\n",
       "       4.0          45\n",
       "       5.0          18\n",
       "1993   2.0           5\n",
       "       3.0          11\n",
       "       4.0          57\n",
       "       5.0          17\n",
       "1994   2.0           1\n",
       "       3.0          11\n",
       "       4.0          57\n",
       "       5.0          12\n",
       "1995   1.0           1\n",
       "       2.0           3\n",
       "       3.0          11\n",
       "       4.0          43\n",
       "       5.0          15\n",
       "1996   3.0           6\n",
       "       4.0          38\n",
       "       5.0          17\n",
       "1997   1.0           1\n",
       "       2.0           3\n",
       "       3.0           7\n",
       "       4.0          40\n",
       "       5.0          23\n",
       "Name: happiness, Length: 345, dtype: int64"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.groupby(['birth', 'happiness'])['happiness'].count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [],
   "source": [
    "df['car'].replace(-8, 0, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "car  happiness\n",
       "0    2.0             1\n",
       "     3.0             2\n",
       "     4.0             5\n",
       "1    1.0             8\n",
       "     2.0            30\n",
       "     3.0           123\n",
       "     4.0           872\n",
       "     5.0           329\n",
       "2    1.0            96\n",
       "     2.0           466\n",
       "     3.0          1034\n",
       "     4.0          3941\n",
       "     5.0          1081\n",
       "Name: happiness, dtype: int64"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.groupby(['car', 'happiness'])['happiness'].count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<seaborn.axisgrid.FacetGrid at 0x2f7e7c471d0>"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABaYAAAEYCAYAAACnaCGEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3X+0bnV9H/j3x3tBbaMB9MYiYGHMbVOMLdpbpKVJLBq9klZoBzvYRNExQzILTFyTTIJtGo2GtZKZRlp/xCmJVMgYCVETbxwqJUaTSKJyiYSfIdyiIzcwcgn+rBMykM/88eyrD9dzLwc4ez/nOef1Wmuv8+zv/u7n+Zx97nqvez7PPt+nujsAAAAAADCVx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97r65qi5M8rtV9WCSTyd5Y5Jfr6o/S/KJJCcssERgSckXYCzyBRiLfAHGJGNYS9V94N33AAAAAAAwHkt5AAAAAAAwKY1pAAAAAAAmpTENAAAAAMCkNKYBAAAAAJiUxjQAAAAAAJPSmAYAAAAAYFIa0wAAAAAATOr/B7nljd65TjYsAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 1440x288 with 5 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.factorplot('car', col='happiness', data=df, kind='count')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [],
   "source": [
    "# df.pivot_table(values='car', index=['province','city'], columns='happiness', aggfunc='count', margins=True,dropna=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [],
   "source": [
    "# df.groupby(['city', 'happiness'])['happiness'].count()\n",
    "# help(df.pivot_table)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<seaborn.axisgrid.FacetGrid at 0x2f7f0dc3898>"
      ]
     },
     "execution_count": 108,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABsYAAAEYCAYAAADvbUP1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3X+0bHddH/z3J7koIJQEuVBMworFLJFKjZgVqWkJQg0BhYBLnmKLRLRP5FkEtYvWQnlqFOoqPoK0gIViTRMUxYggASkkpZpgLD8SDCQEIllI4ZqUBAOIpfI08Okfsy+cnHvOzbm5s8+c2fv1WmuvmfnuPTOf786e9725n9l7qrsDAAAAAAAAU3fMqgsAAAAA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PpV2S939/1fVDyV5RVXdL4vPxr9N8qdJfmMYqyQv7+7PVdWLq+p7s/jWwQ1J/vNRzxbYbTIGGJucAcYkY4AxyRhgbHKGlanurc42hL2rqi5K8rbufuOm8R/N4gcXz19FXcA0yBhgbHIGGJOMAcYkY4CxyRl2g0spAgAAAAAAMAvOGAMAAAAAAGAWnDEGAAAAAADALGiMAQAAAAAAMAsaYwAAAAAAAMyCxhgAAAAAAACzoDEGAAAAAADALPwfBksaaDRL29wAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 1728x288 with 6 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# df.groupby(['depression', 'happiness'])['depression'].count()\n",
    "sns.factorplot('happiness', col='depression', data=df, kind='count')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.survey_time = [i.split(' ')[0] for i in df.survey_time]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "survey_time  happiness\n",
       "2015/10/1    1.0           5\n",
       "             2.0           1\n",
       "             3.0           6\n",
       "             4.0          36\n",
       "             5.0          14\n",
       "2015/10/10   4.0           2\n",
       "2015/10/11   1.0           1\n",
       "             4.0           7\n",
       "             5.0           5\n",
       "2015/10/12   3.0           1\n",
       "             5.0           2\n",
       "2015/10/13   4.0           1\n",
       "2015/10/14   5.0           1\n",
       "2015/10/15   4.0           3\n",
       "2015/10/16   4.0           2\n",
       "2015/10/17   2.0           2\n",
       "             3.0           8\n",
       "             4.0          32\n",
       "             5.0          14\n",
       "2015/10/18   2.0           2\n",
       "             3.0           5\n",
       "             4.0          27\n",
       "             5.0          13\n",
       "2015/10/2    1.0           1\n",
       "             2.0           1\n",
       "             3.0          11\n",
       "             4.0          30\n",
       "             5.0          12\n",
       "2015/10/22   4.0           2\n",
       "2015/10/23   4.0           1\n",
       "                          ..\n",
       "2015/9/30    2.0           1\n",
       "             3.0           1\n",
       "             4.0          17\n",
       "             5.0           4\n",
       "2015/9/4     1.0           1\n",
       "             2.0           1\n",
       "             3.0           7\n",
       "             4.0           7\n",
       "             5.0           7\n",
       "2015/9/5     3.0           4\n",
       "             4.0           8\n",
       "2015/9/6     1.0           1\n",
       "             2.0           3\n",
       "             3.0           7\n",
       "             4.0          16\n",
       "             5.0           6\n",
       "2015/9/7     1.0           2\n",
       "             2.0           2\n",
       "             3.0          11\n",
       "             4.0          17\n",
       "             5.0           4\n",
       "2015/9/8     2.0           2\n",
       "             3.0           6\n",
       "             4.0          14\n",
       "             5.0           9\n",
       "2015/9/9     1.0           1\n",
       "             2.0           2\n",
       "             3.0           6\n",
       "             4.0          21\n",
       "             5.0           5\n",
       "Name: happiness, Length: 462, dtype: int64"
      ]
     },
     "execution_count": 113,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.groupby(['survey_time', 'happiness'])['happiness'].count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<seaborn.axisgrid.FacetGrid at 0x2f7f1abd080>"
      ]
     },
     "execution_count": 119,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAkYAAAEYCAYAAAC5sTl2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAGIlJREFUeJzt3X+wZGV95/H3hwFRghEMVxYZUrhkIkFdR5xCFEtQNjjgktEsJlBR0OCOVoGrVe6m0K0sRmVLd1UUNaRwnQwYAiECOhgWnEWEqIswkBEYkDCFrEyYZQZR1LCLBX73j36uNpe+dy5M/7jd9/2q6urTz3nO6e8zdeepT59zuk+qCkmSJMEuoy5A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GLG+vLwHeAvxGV5+PAO9uy2uBq+iE92V07p/zTOBtwFY6d41+Fp2fk1/RtvlZez6Kzp2ll7bt/xfwajq/QPxtYKr1+0NgTVu+H9i9Le/Vnq+gc8NDgD2BXUf97+jDx2J4OF/4GOXDW4JomL5fVdO3F7iZzuT34iQfAfaiM5lc3dX/kqr6BXB3knuAg1v7+qr6IUCSy+hMYhtmvNeNVbWl9dnY3uvHwIuB9e0D4RI6kybArcCFSb4MfLm1fQv4ZJILgcum9ydpKJwvNBKeStMwPdq1/Dide+WsBU6vqpcAf0bnU960mferqR207+i9AmyqquXt8ZKqOqb1eQPwOeDlwM1Jdq2qjwLvoPNJ84YkByNpWJwvNBIGI43as4GtSXYD/mjGujcn2SXJQcC/BO5q7b+b5Lnp3C37jXQ+qc3HXcBUklcCJNktyYuS7AIcUFXXAn9C+zSa5KCquq2qPkbnE6YTnTRazhcaOE+ladT+FPgO8L+B2+hMfNPuAq6jc0fmd1XV/2uHtL8JfBH4LTp3Z555WLynqvp5khOAc5I8h87f/6eAfwT+qrUFOLuqfpzkw0leS+cT5B3A/9jp0UraGc4XGrhU9TqqKI1WkrXAV6vqSzPa30bn4snTR1GXpIXH+UL95Kk0SZKkxiNGkiRJjUeMJEmSGoORJElSYzCSJElqDEaSJEmNwUiSJKn5/0ZoFeH9OrwFAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 576x288 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.factorplot('happiness', col='gender', data=df, kind='count')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "nationality  happiness\n",
       "-8           1.0             1\n",
       "             2.0             1\n",
       "             3.0             5\n",
       "             4.0             7\n",
       "             5.0             4\n",
       " 1           1.0            91\n",
       "             2.0           444\n",
       "             3.0          1076\n",
       "             4.0          4419\n",
       "             5.0          1305\n",
       " 2           1.0             1\n",
       "             3.0             1\n",
       "             4.0            11\n",
       "             5.0             7\n",
       " 3           1.0             3\n",
       "             2.0             3\n",
       "             3.0             8\n",
       "             4.0            39\n",
       "             5.0            16\n",
       " 4           1.0             8\n",
       "             2.0             8\n",
       "             3.0            13\n",
       "             4.0            82\n",
       "             5.0            46\n",
       " 5           3.0             1\n",
       "             4.0             2\n",
       " 6           2.0             9\n",
       "             3.0            15\n",
       "             4.0            65\n",
       "             5.0             7\n",
       " 7           4.0             1\n",
       " 8           2.0            32\n",
       "             3.0            40\n",
       "             4.0           192\n",
       "             5.0            25\n",
       "Name: happiness, dtype: int64"
      ]
     },
     "execution_count": 124,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.nationality.unique()\n",
    "# sns.factorplot('happiness', col='nationality', data=df, kind='count')\n",
    "df.groupby(['nationality', 'happiness'])['happiness'].count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<seaborn.axisgrid.FacetGrid at 0x2f7f2debc50>"
      ]
     },
     "execution_count": 128,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA2YAAAEYCAYAAAA3YuVmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3X+0XWV95/H3x4QftloBvTo0iSuMpipqG2mKTOkSihYj1kJbbHFVRYdO2llgddW2atdUFGUt7YxitUpLJQWsFSlqiS4qTVVwtPIjaAQDUlKlcksGQvmh1JFZwe/8cZ7U4+XemxNyztn3nvt+rbXX2fvZz97n+1xPvvg9e+/npKqQJEmSJHXnUV0HIEmSJElLnYWZJEmSJHXMwkySJEmSOmZhJkmSJEkdszCTJEmSpI5ZmEmSJEl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LluQpVXVjVb2T3jdfJkBp4TKXSBoGc4nGylsZtZD8EXAN8C/AjfQS4m63AFcBTwJ+u6q+1y71fwH4EPBU4K+raubtArOqqv+X5GTgvUkeR+/fwnuAfwL+qrUFOKeq7kvytiQ/T++brZuAv9vn0UoaFXOJpGEwl2isUjXbFVZp4UhyAfCpqrp0Rvur6D1Ue0YXcUlaXMwlkobBXKJR8VZGSZIkSeqYV8wkSZIkqWNeMZMkSZKkjlmYSZIkSVLHLMwkSZIkqWMWZpIkSZLUMQszSZIkSerY/weobY2NM2wFYwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 864x288 with 3 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df.religion.unique()\n",
    "sns.factorplot('happiness', col='religion', data=df, kind='count')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "metadata": {},
   "outputs": [],
   "source": [
    "df['income'] = df['income'].map(lambda i: np.log(i) if i>1 else 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 142,
   "metadata": {},
   "outputs": [],
   "source": [
    "# df.groupby(['class', 'happiness'])['happiness'].count()\n",
    "df.work_status.fillna(0, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 144,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.work_yr.fillna(0, inplace=True)\n",
    "df.work_type.fillna(0, inplace=True)\n",
    "df.work_manage.fillna(0, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 145,
   "metadata": {},
   "outputs": [],
   "source": [
    "df['family_income'] = df['family_income'].map(lambda i: np.log(i) if i>1 else 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 159,
   "metadata": {},
   "outputs": [],
   "source": [
    "# df.dtypes[df.dtypes == 'object']\n",
    "df = pd.get_dummies(df, columns=['survey_time'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 建模"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 160,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\Voyager\\Anaconda3\\lib\\site-packages\\pandas\\core\\frame.py:3694: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
      "  errors=errors)\n"
     ]
    }
   ],
   "source": [
    "train = df[:train_len]\n",
    "test = df[train_len:]\n",
    "test.drop('happiness', axis=1, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 161,
   "metadata": {},
   "outputs": [],
   "source": [
    "Y_train = train['happiness'] \n",
    "X_train = train.drop('happiness', axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 168,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Fitting 5 folds for each of 9 candidates, totalling 45 fits\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[Parallel(n_jobs=-1)]: Done  45 out of  45 | elapsed:  6.3min finished\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "RandomForestClassifier(bootstrap=True, class_weight=None, criterion='gini',\n",
       "            max_depth=None, max_features=0.33, max_leaf_nodes=None,\n",
       "            min_impurity_decrease=0.0, min_impurity_split=None,\n",
       "            min_samples_leaf=1, min_samples_split=2,\n",
       "            min_weight_fraction_leaf=0.0, n_estimators=500, n_jobs=1,\n",
       "            oob_score=False, random_state=None, verbose=0,\n",
       "            warm_start=False)"
      ]
     },
     "execution_count": 168,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.ensemble import RandomForestClassifier\n",
    "from sklearn.model_selection import StratifiedKFold\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "\n",
    "kfold = StratifiedKFold(n_splits=5)\n",
    "rf = RandomForestClassifier()\n",
    "rf_params = {\n",
    "    'max_features': ['auto', 'sqrt', 0.33],\n",
    "    'n_estimators':[100,300,500]\n",
    "}\n",
    "gsrf = GridSearchCV(rf, param_grid=rf_params, cv=kfold, scoring='accuracy', n_jobs=-1, verbose=1)\n",
    "gsrf.fit(X_train, Y_train)\n",
    "gsrf.best_estimator_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 170,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.6260640961442163"
      ]
     },
     "execution_count": 170,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gsrf.best_score_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 171,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_happiness = pd.Series(gsrf.predict(test), name='happiness')\n",
    "results = pd.concat([IDtest, test_happiness], axis=1)\n",
    "results.to_csv('0830_submission.csv', index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 172,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>happiness</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>8001</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>8002</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>8003</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>8004</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>8005</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>8006</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>8007</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8008</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>8009</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>8010</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>8011</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>8012</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>8013</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>8014</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>8015</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>8016</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>8017</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>8018</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>8019</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>8020</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>8021</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>8022</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>8023</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>8024</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>8025</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>8026</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>8027</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>8028</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>8029</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>8030</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2938</th>\n",
       "      <td>10939</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2939</th>\n",
       "      <td>10940</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2940</th>\n",
       "      <td>10941</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2941</th>\n",
       "      <td>10942</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2942</th>\n",
       "      <td>10943</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2943</th>\n",
       "      <td>10944</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2944</th>\n",
       "      <td>10945</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2945</th>\n",
       "      <td>10946</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2946</th>\n",
       "      <td>10947</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2947</th>\n",
       "      <td>10948</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2948</th>\n",
       "      <td>10949</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2949</th>\n",
       "      <td>10950</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2950</th>\n",
       "      <td>10951</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2951</th>\n",
       "      <td>10952</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2952</th>\n",
       "      <td>10953</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2953</th>\n",
       "      <td>10954</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2954</th>\n",
       "      <td>10955</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2955</th>\n",
       "      <td>10956</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2956</th>\n",
       "      <td>10957</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2957</th>\n",
       "      <td>10958</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2958</th>\n",
       "      <td>10959</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2959</th>\n",
       "      <td>10960</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2960</th>\n",
       "      <td>10961</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2961</th>\n",
       "      <td>10962</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2962</th>\n",
       "      <td>10963</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2963</th>\n",
       "      <td>10964</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2964</th>\n",
       "      <td>10965</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2965</th>\n",
       "      <td>10966</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2966</th>\n",
       "      <td>10967</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2967</th>\n",
       "      <td>10968</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2968 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         id  happiness\n",
       "0      8001        4.0\n",
       "1      8002        2.0\n",
       "2      8003        3.0\n",
       "3      8004        4.0\n",
       "4      8005        4.0\n",
       "5      8006        4.0\n",
       "6      8007        4.0\n",
       "7      8008        5.0\n",
       "8      8009        4.0\n",
       "9      8010        4.0\n",
       "10     8011        4.0\n",
       "11     8012        4.0\n",
       "12     8013        4.0\n",
       "13     8014        4.0\n",
       "14     8015        4.0\n",
       "15     8016        4.0\n",
       "16     8017        4.0\n",
       "17     8018        4.0\n",
       "18     8019        4.0\n",
       "19     8020        4.0\n",
       "20     8021        4.0\n",
       "21     8022        4.0\n",
       "22     8023        4.0\n",
       "23     8024        4.0\n",
       "24     8025        4.0\n",
       "25     8026        4.0\n",
       "26     8027        4.0\n",
       "27     8028        4.0\n",
       "28     8029        4.0\n",
       "29     8030        4.0\n",
       "...     ...        ...\n",
       "2938  10939        5.0\n",
       "2939  10940        4.0\n",
       "2940  10941        4.0\n",
       "2941  10942        4.0\n",
       "2942  10943        4.0\n",
       "2943  10944        3.0\n",
       "2944  10945        4.0\n",
       "2945  10946        4.0\n",
       "2946  10947        4.0\n",
       "2947  10948        4.0\n",
       "2948  10949        4.0\n",
       "2949  10950        4.0\n",
       "2950  10951        4.0\n",
       "2951  10952        4.0\n",
       "2952  10953        4.0\n",
       "2953  10954        4.0\n",
       "2954  10955        4.0\n",
       "2955  10956        4.0\n",
       "2956  10957        4.0\n",
       "2957  10958        4.0\n",
       "2958  10959        4.0\n",
       "2959  10960        4.0\n",
       "2960  10961        4.0\n",
       "2961  10962        4.0\n",
       "2962  10963        4.0\n",
       "2963  10964        5.0\n",
       "2964  10965        4.0\n",
       "2965  10966        4.0\n",
       "2966  10967        4.0\n",
       "2967  10968        5.0\n",
       "\n",
       "[2968 rows x 2 columns]"
      ]
     },
     "execution_count": 172,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.concat([IDtest, test_happiness], axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
